<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8" isELIgnored="false"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!-- http://java.sun.com/jsp/jstl/fmt 它主要是完成国际化信息 和数据的格式化 -->
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt"  prefix="fmt"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="en-US" xml:lang="en">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>Estore购物商城</title>

    <link rel="stylesheet" href="style.css" type="text/css" media="screen" />
    <!--[if IE 6]><link rel="stylesheet" href="style.ie6.css" type="text/css" media="screen" /><![endif]-->
    <!--[if IE 7]><link rel="stylesheet" href="style.ie7.css" type="text/css" media="screen" /><![endif]-->

	<script type="text/javascript" src="script.js"></script>
	<script type="text/javascript">
		function _buyProduct( id ){
			var path =  "<%=request.getContextPath()%>";
			window.location.href = path + "/buyServlet?id="+id;
		}
	</script>
</head>
<body>
<div id="art-main">
        <div class="art-sheet">
            <div class="art-sheet-tl"></div>
            <div class="art-sheet-tr"></div>
            <div class="art-sheet-bl"></div>
            <div class="art-sheet-br"></div>
            <div class="art-sheet-tc"></div>
            <div class="art-sheet-bc"></div>
            <div class="art-sheet-cl"></div>
            <div class="art-sheet-cr"></div>
            <div class="art-sheet-cc"></div>
            <div class="art-sheet-body">
                <%@include file="header.jsp" %>
                <div class="art-content-layout">
                    <div class="art-content-layout-row">
                        <div class="art-layout-cell art-content">
                            <div class="art-post">
                                <div class="art-post-tl"></div>
                                <div class="art-post-tr"></div>
                                <div class="art-post-bl"></div>
                                <div class="art-post-br"></div>
                                <div class="art-post-tc"></div>
                                <div class="art-post-bc"></div>
                                <div class="art-post-cl"></div>
                                <div class="art-post-cr"></div>
                                <div class="art-post-cc"></div>
                                <div class="art-post-body">
									  <!-- 产品列表 -->
									  <div class="product_storyList_content">
									  <c:if test="${ empty list }">还没有添加任何商品</c:if>
									  <c:if test="${ not empty list }">
									    <!--列表开始-->
									    	<c:forEach var="product" items="${list }">
									         <div class="product_storyList_content_left">
									         		<!-- 这里是需要从服务器中获取当前这个商品的真实图片 -->
									         		<img src="${pageContext.request.contextPath }${product.imgurl_s}"  alt="图书列表"/>
									         </div>
									         <div class="product_storyList_content_right">
									            <ul>
									            	<!-- 商品的名称的名称 -->
									              <li class="product_storyList_content_dash"><a href="#" class="blue_14">${product.name } </a></li>
									              	<!-- 商品的描述 -->
									              <li>${product.description }</li>
									              <li>库存情况：<c:if test="${product.pnum == 0 }">商品售罄</c:if>
									              		<c:if test="${product.pnum > 0 }">${product.pnum } 件</c:if>
									              </li>
									              <li>
									              <dl class="product_content_dd">
									              
									              <dd><img src="images/product_buy_01.gif" alt="shopping" 
									              onclick="_buyProduct('${product.id}');"/></dd>
									              
									              <dd>节省：￥${product.marketprice - product.estoreprice }</dd>
									              <dd>折扣：<fmt:formatNumber maxFractionDigits="2" minFractionDigits="2" 
									              value="${product.estoreprice*10/product.marketprice }"></fmt:formatNumber>折</dd>
									              <dd class="footer_dull_red">￥${product.estoreprice}</dd>
									               <dd class="product_content_delete">￥${product.marketprice}</dd>
									              </dl>
									              　</li>
									           </ul>
									      </div>
									       <div class="product_storyList_content_bottom"></div>
									       </c:forEach>
									   </c:if>
									  </div>
									  <!-- 产品列表结束 -->                        
                           			<div class="cleared"></div>
                                </div>
                            </div>
                        </div> 
                        <%@include file="sidebar.jsp" %>
                    </div>
                </div>
                <div class="cleared"></div>
                <%@include file="footer.jsp" %> 
        		<div class="cleared"></div>
            </div>
        </div>
        <div class="cleared"></div>
    </div>
</body>
</html>